#ifndef _NAMETOKTYPE_H_
#define _NAMETOKTYPE_H_
#include "SimpleNode.h"
#include "AstTypes.h"
class IVisitor;
class NameTokType;
typedef QSharedPointer<NameTokType> NameTokTypePtr;

class NameTokType: public SimpleNode
{
public:
    explicit NameTokType(int nodeId=-1);
    virtual ~NameTokType();
    
    
    
    virtual Ast::AstTypes type() const;
    virtual QString toString() const;
    virtual void accept(IVisitor* visitor, const SimpleNodePtr& node);
    virtual void traverse(IVisitor* visitor);
private:
};



typedef QListIterator<NameTokTypePtr> NameTokTypePtrListIterator;

class NameTokTypeList: public QList<NameTokTypePtr>
{
public:
    inline NameTokTypeList() { }
    inline explicit NameTokTypeList(NameTokTypePtr i) { append(i); }
    inline NameTokTypeList(const NameTokTypeList &l) : QList<NameTokTypePtr>(l) { }
    inline NameTokTypeList(const QList<NameTokTypePtr> &l) : QList<NameTokTypePtr>(l) { }

    inline NameTokTypeList operator+(const NameTokTypeList &other) const
    { NameTokTypeList n = *this; n += other; return n; }
    inline NameTokTypeList &operator<<(NameTokTypePtr it)
    { append(it); return *this; }
    inline NameTokTypeList &operator<<(const NameTokTypeList &l)
    { *this += l; return *this; }

    QString toString() const
    {
        QString str("NameTokTypeList(");
        foreach(NameTokTypePtr it, *this){
            if (it != NULL){
                str += it->toString()+",";
            }
        }
        str += ")";
        return str;
    }

    void traverse(IVisitor* visitor)
    {
        foreach(NameTokTypePtr it, *this){
            if (it != NULL){
                it->accept(visitor, it);
            }
        }
    }
};



#endif